/*
 * Copyright (c) 2020-2099 the original author or authors. All rights reserve.
 */
package org.tianyun.cloud.security.token.common;

import java.io.Serializable;
import java.security.Principal;
import java.util.Map;

/**
 * authentication information
 *
 * @auther ebert_chan
 */
public class Authentication implements Principal, Serializable {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 1L;

    /**
     * principal name
     */
    private String name;

    /**
     * access raw data value
     */
    private Map<String, Object> rawValue;

    public Authentication() {
    }

    public Authentication(String name) {
        this(name, null);
    }

    public Authentication(String name, Map<String, Object> rawValue) {
        this.setName(name);
        this.setRawValue(rawValue);
    }

    /*
     * @see java.security.Principal#getName()
     */
    @Override
    public String getName() {
        return this.name;
    }

    public Map<String, Object> getRawValue() {
        return rawValue;
    }

    public void setRawValue(Map<String, Object> rawValue) {
        this.rawValue = rawValue;
    }

    public void setName(String name) {
        this.name = name;
    }

}
